home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 20
/
Cream of the Crop 20 (Terry Blount) (1996).iso
/
image
/
stview11.zip
/
STARVIEW.MEX
< prev
next >
Wrap
Text File
|
1996-06-21
|
3KB
|
137 lines
/////////////////////////////////////////////////////////////////////////////
//
// StarView V1.0 (!)1996 Larry Monte/StarLab Systems SoftWare
//
//
#define INCL_starview
#include <max.mh>
#include <starview.mh>
#include <language.mh>
struct _ffind: ff;
char: nonstop;
void cleanup() // Clear out work dir
{
if(filefindfirst(ff,STARVIEW_PATH+"temp"+this_task+"\\*.*",FA_NORMAL))
{
do
{
remove(STARVIEW_PATH+"temp"+this_task+"\\"+strupper(ff.filename));
}
while(filefindnext(ff));
filefindclose(ff);
}
}
void do_unpack(string: fname, string: work_path)
{
filecopy(farea.downpath+fname,work_path+"\\"+fname);
#ifdef DOS
shell(IOUTSIDE_DOS|IOUTSIDE_REREAD,STARVIEW_PATH+"unpack.bat "+
work_path+" "+work_path+"\\"+fname);
#endif
#ifdef OS2
shell(IOUTSIDE_DOS|IOUTSIDE_REREAD,STARVIEW_PATH+"unpack.cmd "+
work_path+" "+work_path+"\\"+fname);
#endif
}
int get_txt(string: fname, string: work_path)
{
int: file_index, found, in_num, see_more;
string: in;
array [1..100] of string: arc_fname;
file_index := 0;
reset_more(nonstop);
print(AVATAR_CLS,str_stv_file_hdr);
if(filefindfirst(ff,work_path+"\\*.*",FA_NORMAL))
{
do
{
found := do_spec(strupper(ff.filename));
if(found = 1)
{
file_index := file_index +1;
arc_fname[file_index] := strupper(ff.filename);
print(COL_LBLUE, file_index, " - "+COL_YELLOW+
strpad(arc_fname[file_index],14,' ')+
COL_GREEN+longpadleft(ff.filesize,9,' ')+"\n");
}
}
while(filefindnext(ff) AND do_more(nonstop,COL_CYAN));
filefindclose(ff);
}
if(file_index = 0)
{
print(str_stv_no_files);
menu_cmd(106,"");
return 0;
}
print(str_stv_see_cont);
input_str(in,INPUT_NLB_LINE,0,3,"");
in_num := strtoi(in);
if(in_num <> 0)
{
print(AVATAR_CLS);
display_file(work_path+"\\"+arc_fname[in_num],nonstop);
see_more := input_list("YN",0,"","",str_stv_see_another);
if(see_more = 'y' OR see_more = 'Y')
return 1;
}
return 0;
}
void main()
{
int: ok;
char: ch;
string: fname, work_path;
init_lang_starview();
work_path := STARVIEW_PATH+"temp"+this_task;
print(AVATAR_CLS+COL_LBLUE+strpad("",79,'─')+"\n");
print(COL_YELLOWONBLUE+str_stv_header);
print(COL_LBLUE+strpad("",79,'─')+"\n");
print(str_stv_getfname);
input_str(fname,INPUT_WORD,0,14,"");
cleanup();
if(fileexists(farea.downpath+fname)=False)
{
print(str_stv_not_found);
menu_cmd(106,"");
return;
}
do_unpack(fname,work_path);
while(get_txt(fname,work_path)=1);
cleanup();
print(AVATAR_CLS+str_stv_tag_file+strupper(fname)+str_stv_tag_end);
ch := getch();
if(ch = 'Y' or ch = 'y')
{
input := "A;"+fname;
menu_cmd(512,"");
}
print("\n");
menu_cmd(106,"");
}